Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bianco.dom-to-array

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bianco.dom-to-array

Converts any DOM node/s to a loopable array

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
678
decreased by-30.32%
Maintainers
1
Weekly downloads
 
Created
Source

bianco.dom-to-array

Build Status

NPM version NPM downloads MIT License

Usage

import domToArray from 'bianco.dom-to-array'

var div = document.createElement('div')
div.innerHTML = `
  <ul>
    <li>one</li>
    <li>two</li>
  </ul>
`
body.appendChild(div)

// It can convert node list
const lis = document.querySelectorAll('li')
const $lis = domToArray(lis)
$lis.length // => 2
Array.isArray($lis) // => true

// It can convert a single node
const li = document.querySelector('li')
const $li = domToArray(li)
$li.length // => 1
Array.isArray($li) // => true

API

domToArray

Converts any DOM node/s to a loopable array

Parameters

  • els (HTMLElement | NodeList) single html element or a node list

Returns Array always a loopable object

Keywords

FAQs

Package last updated on 21 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc